import request from '@/utils/request'

// 分页查询
export function listCustomerForPage(query) {
  return request({
    url: '/system/customer/listCustomerForPage',
    method: 'get',
    params: query
  })
}
// 查询全部正常的客户
export function queryAllCustomer(status) {
  return request({
    url: 'system/customer/queryAllCustomer/' + status,
    method: 'get'
  })
}
// 添加
export function addCustomer(data) {
  return request({
    url: '/system/customer/addCustomer',
    method: 'post',
    params: data
  })
}
// 修改
export function updateCustomer(data) {
  return request({
    url: '/system/customer/updateCustomer',
    method: 'put',
    params: data
  })
}
// 删除
export function deleteCustomerByIds(customerIds) {
  return request({
    url: '/system/customer/deleteCustomerByIds/' + customerIds,
    method: 'delete'
  })
}
// 查询一个
export function getCustomerById(id) {
  return request({
    url: '/system/customer/getCustomerById/' + id,
    method: 'get'
  })
}
// 加载省份，部署方式下拉框
export function loadDataSelect(type) {
  return request({
    url: 'system/customer/loadDataSelect/' + type,
    method: 'get'
  })
}
// 加载省份城市层次json数据
export function queryAddressNode() {
  return request({
    url: '/system/other/queryAddressNode',
    method: 'get'
  })
}
// 查询一个
export function getAddressData(deployment) {
  return request({
    url: '/system/customer/getAddressData/' + deployment,
    method: 'get'
  })
}
